package com.metadata_system.common.db.entity;

import java.util.Date;
import javax.persistence.*;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Table(name = "md_message")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Message {
    @Id
    private Integer id;

    /**
     * 消息内容
     */
    private String content;

    /**
     * 项目ID
     */
    @Column(name = "project_id")
    private Integer projectId;

    /**
     * 项目ID
     */
    @Column(name = "project_name")
    private String projectName;

    /**
     * 用户ID
     */
    @Column(name = "user_id")
    private Integer userId;

    /**
     * 是否读取: 0.否 1.是 
     */
    @Column(name = "is_read")
    private Integer isRead;

    /**
     * 类型: ProjectUser.项目成员变动 ProjectApply.项目数据修改-申请 ProjectHandler.项目数据修改-处理
     */
    private String type;

    /**
     * 消息参数
     */
    private String params;

    /**
     * 时间
     */
    @Column(name = "created_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createdTime;
}